#!/bin/bash
#FIXME: Não executar esse script mais de uma vez dentro de um período de 2 minutos, vide Socket TIME_WAIT.
./sockets -s 50000 > server.out &
(sleep 1 && ./sockets -i localhost 50000 50001 > node1.out) &
(sleep 1 && ./sockets -i localhost 50000 50002 > node2.out) &
(sleep 2 && ./sockets -i localhost 50001 50003 > node3.out) &
(sleep 2 && ./sockets -i localhost 50001 50004 > node4.out) &
(sleep 2 && ./sockets -i localhost 50002 50005 > node5.out) &
(sleep 2 && ./sockets -i localhost 50002 50006 > node6.out) &
(sleep 3 && ./sockets -c localhost 50003 > client1.out) &
(sleep 3 && ./sockets -c localhost 50003 > client2.out) &
(sleep 3 && ./sockets -c localhost 50004 > client3.out) &
(sleep 3 && ./sockets -c localhost 50004 > client4.out) &
(sleep 3 && ./sockets -c localhost 50005 > client5.out) &
(sleep 3 && ./sockets -c localhost 50005 > client6.out) &
(sleep 3 && ./sockets -c localhost 50006 > client7.out) &
(sleep 3 && ./sockets -c localhost 50006 > client8.out)

